/**
 * @author liubaohui
 * @desc 多选的列表选中行高亮，单选列表直接使用highlight-current-row属性
 * @param row row-class-name回调的row
 * @param selectedItems {Array} 选中项数组
 * @param [attr = 'id'] {string} 匹配的属性
 * @param [className = 'line_selected'] {string} 返回的样式class
 * @returns {string}
 */
export default function highlightSelectedRow(row, selectedItems, attr = 'id', className = 'line_selected') {
  if (row[attr] !== undefined && selectedItems.some(item => item[attr] === row[attr])) {
    return className
  }
}
